package com.yyoa.dao.impl;

import org.springframework.stereotype.Repository;

import com.yyoa.dao.UserDao;
import com.yyoa.entity.User;

@Repository("userDao")
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	@Override
	public User getByUserName(String userName) {
		String hql = "from User as user where user.userName=?";
		return getByHQL(hql, userName);
	}

	@Override
	public User getByEmail(String email) {
		String hql = "from User as user where user.email=?";
		return getByHQL(hql, email);
	}

	@Override
	public User getByMobilePhone(Long mobilePhone) {
		String hql = "from User as user where user.mobilePhone=?";
		return getByHQL(hql, mobilePhone);
	}
}
